﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using ELab.Controls.flatstyle; 

namespace ELab.Controls
{
    public class FlatstylePanel : Panel
    {
        public FlatstylePanel()
        {
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            ControlPaint.DrawBorder(e.Graphics, new Rectangle(0, 0, this.ClientSize.Width, this.ClientSize.Height), this.BorderColor, ButtonBorderStyle.Solid);
            base.OnPaint(e);
        }

        private BorderDrawer borderDrawer = new BorderDrawer();
        /// <summary>
        /// Color of object's border
        /// </summary>
        public Color BorderColor
        {
            get { return borderDrawer.BorderColor; }
            set
            {
                borderDrawer.BorderColor = value;
                Invalidate();
            }
        }

        protected override void OnClientSizeChanged(EventArgs e)
        {
            base.OnClientSizeChanged(e);
            Invalidate();
        } 
    }
}
